<html>
<head><meta charset="utf-8"><title>weekly meeting 2018-11-19 · wg-traits · Zulip Chat Archive</title></head>
<h2>Stream: <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/index.html">wg-traits</a></h2>
<h3>Topic: <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/weekly.20meeting.202018-11-19.html">weekly meeting 2018-11-19</a></h3>

<hr>

<base href="https://rust-lang.zulipchat.com">

<head><link href="https://rust-lang.github.io/zulip_archive/style.css" rel="stylesheet"></head>

<a name="147986009"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/weekly%20meeting%202018-11-19/near/147986009" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/weekly.20meeting.202018-11-19.html#147986009">(Nov 19 2018 at 19:01)</a>:</h4>
<p><span class="emoji emoji-1f44b" title="wave">:wave:</span> <span class="user-group-mention" data-user-group-id="692">@WG-compiler-traits</span></p>



<a name="147986112"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/weekly%20meeting%202018-11-19/near/147986112" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/weekly.20meeting.202018-11-19.html#147986112">(Nov 19 2018 at 19:02)</a>:</h4>
<p>Some quick notes:</p>
<ul>
<li>This is Thanksgiving week in the US, which means that Thu-Fri many of us (including me) won't be around.</li>
<li>It's also the week of a "self-imposed" deadline on Rust 2018 beta backports and things, which has kind of kept me busy. I'm running a bit behind on reviews (<em>cough</em> sorry <span class="user-mention" data-user-id="124069">@Alexander Regueiro</span> <em>cough</em>).</li>
<li>The good news (from my POV) is that, theoretically, after Thanksgiving, there'll be a lot less to do.</li>
</ul>



<a name="147986127"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/weekly%20meeting%202018-11-19/near/147986127" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/weekly.20meeting.202018-11-19.html#147986127">(Nov 19 2018 at 19:03)</a>:</h4>
<p><a href="https://paper.dropbox.com/doc/WG-Traits-Planning-Meeting-oDfr6ct8xx63HSAOOmIZX#:uid=463067912981955114240329&amp;h2=2018.04.09" target="_blank" title="https://paper.dropbox.com/doc/WG-Traits-Planning-Meeting-oDfr6ct8xx63HSAOOmIZX#:uid=463067912981955114240329&amp;h2=2018.04.09">Planning meeting document</a></p>



<a name="147986413"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/weekly%20meeting%202018-11-19/near/147986413" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/weekly.20meeting.202018-11-19.html#147986413">(Nov 19 2018 at 19:07)</a>:</h4>
<p>PS <span class="user-mention" data-user-id="131694">@scalexm</span> I see you r+'d <a href="https://github.com/rust-lang/rust/issues/55517" target="_blank" title="https://github.com/rust-lang/rust/issues/55517">#55517</a> — thanks =) I was thinking in the meantime that maybe I should add something to try and give a "This behavior recently changed" note on the new coherence errors</p>



<a name="147986527"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/weekly%20meeting%202018-11-19/near/147986527" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> scalexm <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/weekly.20meeting.202018-11-19.html#147986527">(Nov 19 2018 at 19:08)</a>:</h4>
<p><span class="user-mention" data-user-id="116009">@nikomatsakis</span> yes seems good</p>



<a name="147986535"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/weekly%20meeting%202018-11-19/near/147986535" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/weekly.20meeting.202018-11-19.html#147986535">(Nov 19 2018 at 19:08)</a>:</h4>
<p>I'm not 100% sure how to do that :)</p>



<a name="147986554"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/weekly%20meeting%202018-11-19/near/147986554" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/weekly.20meeting.202018-11-19.html#147986554">(Nov 19 2018 at 19:09)</a>:</h4>
<p>I guess I could probably skim over the pending region obligations</p>



<a name="147986559"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/weekly%20meeting%202018-11-19/near/147986559" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/weekly.20meeting.202018-11-19.html#147986559">(Nov 19 2018 at 19:09)</a>:</h4>
<p>(which we just drop on the floor presently)</p>



<a name="147986564"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/weekly%20meeting%202018-11-19/near/147986564" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/weekly.20meeting.202018-11-19.html#147986564">(Nov 19 2018 at 19:09)</a>:</h4>
<p>and look for any that involve a placeholder</p>



<a name="147986579"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/weekly%20meeting%202018-11-19/near/147986579" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/weekly.20meeting.202018-11-19.html#147986579">(Nov 19 2018 at 19:09)</a>:</h4>
<p><span class="user-mention" data-user-id="124069">@Alexander Regueiro</span>, btw, you around? I wanted to sync up with you at some point</p>



<a name="147986670"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/weekly%20meeting%202018-11-19/near/147986670" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/weekly.20meeting.202018-11-19.html#147986670">(Nov 19 2018 at 19:10)</a>:</h4>
<p>so <span class="user-mention" data-user-id="131694">@scalexm</span> in terms of "how to actually integrate"</p>



<a name="147986673"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/weekly%20meeting%202018-11-19/near/147986673" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/weekly.20meeting.202018-11-19.html#147986673">(Nov 19 2018 at 19:10)</a>:</h4>
<p>how's that going?</p>



<a name="147986693"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/weekly%20meeting%202018-11-19/near/147986693" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> scalexm <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/weekly.20meeting.202018-11-19.html#147986693">(Nov 19 2018 at 19:11)</a>:</h4>
<p><span class="user-mention" data-user-id="116009">@nikomatsakis</span> I think I'm going to hit some coherence problems actually</p>



<a name="147986714"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/weekly%20meeting%202018-11-19/near/147986714" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> scalexm <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/weekly.20meeting.202018-11-19.html#147986714">(Nov 19 2018 at 19:11)</a>:</h4>
<p>because the <code>TraitEngine</code> trait is defined in <code>librustc</code>, and the chalk types are defined in <code>librustc_traits</code></p>



<a name="147986726"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/weekly%20meeting%202018-11-19/near/147986726" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/weekly.20meeting.202018-11-19.html#147986726">(Nov 19 2018 at 19:11)</a>:</h4>
<p>bah</p>



<a name="147986729"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/weekly%20meeting%202018-11-19/near/147986729" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/weekly.20meeting.202018-11-19.html#147986729">(Nov 19 2018 at 19:11)</a>:</h4>
<p>we <em>could</em> just move them</p>



<a name="147986790"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/weekly%20meeting%202018-11-19/near/147986790" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/weekly.20meeting.202018-11-19.html#147986790">(Nov 19 2018 at 19:12)</a>:</h4>
<p>or we can do the "bridge trick" I guess</p>



<a name="147986797"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/weekly%20meeting%202018-11-19/near/147986797" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/weekly.20meeting.202018-11-19.html#147986797">(Nov 19 2018 at 19:12)</a>:</h4>
<p>well, I'm not sure I know what the problem is yet</p>



<a name="147986829"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/weekly%20meeting%202018-11-19/near/147986829" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> scalexm <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/weekly.20meeting.202018-11-19.html#147986829">(Nov 19 2018 at 19:12)</a>:</h4>
<p>ok so I have some additional questions for that work anyway :p</p>



<a name="147986862"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/weekly%20meeting%202018-11-19/near/147986862" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/weekly.20meeting.202018-11-19.html#147986862">(Nov 19 2018 at 19:13)</a>:</h4>
<p>carry on :)</p>



<a name="147986951"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/weekly%20meeting%202018-11-19/near/147986951" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Josh Huber <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/weekly.20meeting.202018-11-19.html#147986951">(Nov 19 2018 at 19:14)</a>:</h4>
<p>I've had some personal stuff come up in the past couple weeks, and it's been eating all of my free-time and brain space. If someone needs to steal  <a href="https://github.com/rust-lang/rust/issues/55097" target="_blank" title="https://github.com/rust-lang/rust/issues/55097">#55097</a> to make progress, that's totally great. If I manage to get back to it before then, also great. I am not worried about finding more things to work on... :)</p>



<a name="147986973"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/weekly%20meeting%202018-11-19/near/147986973" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/weekly.20meeting.202018-11-19.html#147986973">(Nov 19 2018 at 19:15)</a>:</h4>
<p><span class="user-mention" data-user-id="120512">@uberjay</span> thanks for mentioning :)</p>



<a name="147986976"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/weekly%20meeting%202018-11-19/near/147986976" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> scalexm <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/weekly.20meeting.202018-11-19.html#147986976">(Nov 19 2018 at 19:15)</a>:</h4>
<p>well basically this is about how long the <code>ChalkContext</code> will live</p>



<a name="147987001"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/weekly%20meeting%202018-11-19/near/147987001" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> scalexm <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/weekly.20meeting.202018-11-19.html#147987001">(Nov 19 2018 at 19:15)</a>:</h4>
<p>since it carries a <code>TyCtxt&lt;'cx, 'gcx, 'gcx&gt;</code>, I guess it will live only as long as a call to e.g. <code>TraitEngine::select_all_or_error</code>?</p>



<a name="147987112"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/weekly%20meeting%202018-11-19/near/147987112" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/weekly.20meeting.202018-11-19.html#147987112">(Nov 19 2018 at 19:17)</a>:</h4>
<p>presumably</p>



<a name="147987128"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/weekly%20meeting%202018-11-19/near/147987128" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/weekly.20meeting.202018-11-19.html#147987128">(Nov 19 2018 at 19:17)</a>:</h4>
<p>this is at least how I imagined it <em>initially</em></p>



<a name="147987163"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/weekly%20meeting%202018-11-19/near/147987163" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/weekly.20meeting.202018-11-19.html#147987163">(Nov 19 2018 at 19:18)</a>:</h4>
<p>but I guess longer term we would like it to persist</p>



<a name="147987184"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/weekly%20meeting%202018-11-19/near/147987184" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/weekly.20meeting.202018-11-19.html#147987184">(Nov 19 2018 at 19:18)</a>:</h4>
<p>so we can leverage the tables for caching</p>



<a name="147987232"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/weekly%20meeting%202018-11-19/near/147987232" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/weekly.20meeting.202018-11-19.html#147987232">(Nov 19 2018 at 19:19)</a>:</h4>
<p>TBH, I hadn't really planned this part out precisely. I considered either creating a "global" <code>ChalkContext</code>, or maybe trying to factor out the persistent part ...</p>



<a name="147987242"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/weekly%20meeting%202018-11-19/near/147987242" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/weekly.20meeting.202018-11-19.html#147987242">(Nov 19 2018 at 19:19)</a>:</h4>
<p>I guess refactor such that it doesn't need to carry a <code>TyCtxt</code></p>



<a name="147987385"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/weekly%20meeting%202018-11-19/near/147987385" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> tmandry <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/weekly.20meeting.202018-11-19.html#147987385">(Nov 19 2018 at 19:21)</a>:</h4>
<p>on rustc guide stuff, I just need to set a date to knock out a bunch of the smaller tasks</p>



<a name="147987389"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/weekly%20meeting%202018-11-19/near/147987389" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/weekly.20meeting.202018-11-19.html#147987389">(Nov 19 2018 at 19:21)</a>:</h4>
<p>but I think I figured that for the first version we'd just recreate context all the time</p>



<a name="147987399"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/weekly%20meeting%202018-11-19/near/147987399" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> tmandry <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/weekly.20meeting.202018-11-19.html#147987399">(Nov 19 2018 at 19:21)</a>:</h4>
<p>I have interviews going on, so not sure when exactly it will happen, but it will :D</p>



<a name="147987470"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/weekly%20meeting%202018-11-19/near/147987470" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> tmandry <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/weekly.20meeting.202018-11-19.html#147987470">(Nov 19 2018 at 19:22)</a>:</h4>
<p>also on the guide, I am thinking more about how to _reduce dependence_ between sections</p>



<a name="147987507"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/weekly%20meeting%202018-11-19/near/147987507" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> tmandry <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/weekly.20meeting.202018-11-19.html#147987507">(Nov 19 2018 at 19:22)</a>:</h4>
<p>i.e. it would be great if you could go to a random section in the traits chapter, and the beginning introduces the problem enough to where you can understand it with minimal context</p>



<a name="147987541"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/weekly%20meeting%202018-11-19/near/147987541" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/weekly.20meeting.202018-11-19.html#147987541">(Nov 19 2018 at 19:23)</a>:</h4>
<p>yeah, that can be a challenge</p>



<a name="147987543"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/weekly%20meeting%202018-11-19/near/147987543" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> tmandry <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/weekly.20meeting.202018-11-19.html#147987543">(Nov 19 2018 at 19:23)</a>:</h4>
<p>I'm not sure how feasible it is, but my feeling is that it would make it dramatically easier to get started / pick things up after awhile</p>



<a name="147987649"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/weekly%20meeting%202018-11-19/near/147987649" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> tmandry <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/weekly.20meeting.202018-11-19.html#147987649">(Nov 19 2018 at 19:24)</a>:</h4>
<p>anyway, something to be thinking about perhaps</p>



<a name="147987656"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/weekly%20meeting%202018-11-19/near/147987656" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> tmandry <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/weekly.20meeting.202018-11-19.html#147987656">(Nov 19 2018 at 19:24)</a>:</h4>
<p>I'm not too worried about "adding noise" for everyone who already knows it, because you can just skim the intro and it gives you a slight confidence boost for the rest of the section :)</p>



<a name="147987687"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/weekly%20meeting%202018-11-19/near/147987687" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/weekly.20meeting.202018-11-19.html#147987687">(Nov 19 2018 at 19:25)</a>:</h4>
<p>yeah</p>



<a name="147987692"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/weekly%20meeting%202018-11-19/near/147987692" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/weekly.20meeting.202018-11-19.html#147987692">(Nov 19 2018 at 19:25)</a>:</h4>
<p>I think that's a really good point</p>



<a name="147987708"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/weekly%20meeting%202018-11-19/near/147987708" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/weekly.20meeting.202018-11-19.html#147987708">(Nov 19 2018 at 19:25)</a>:</h4>
<p>at minimum, if we can kind of "chart out" the things you need to read</p>



<a name="147987715"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/weekly%20meeting%202018-11-19/near/147987715" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/weekly.20meeting.202018-11-19.html#147987715">(Nov 19 2018 at 19:25)</a>:</h4>
<p>i.e., provide a few links to a the most important places</p>



<a name="147987717"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/weekly%20meeting%202018-11-19/near/147987717" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/weekly.20meeting.202018-11-19.html#147987717">(Nov 19 2018 at 19:25)</a>:</h4>
<p>vs just assuming you've read everything</p>



<a name="147987783"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/weekly%20meeting%202018-11-19/near/147987783" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> scalexm <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/weekly.20meeting.202018-11-19.html#147987783">(Nov 19 2018 at 19:26)</a>:</h4>
<p><span class="user-mention" data-user-id="116009">@nikomatsakis</span> ok so second thing I'm not sure to understand is when you currently call <code>tcx.param_env(def_id)</code> where <code>def_id</code> refers to a function say <code>fn foo&lt;'a, T&gt;() where T: 'a</code>, in the <code>ParamEnv</code> you get as a result, the <code>'a</code> lifetime is referred to with an <code>ReEarlyBound</code> right?</p>



<a name="147987803"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/weekly%20meeting%202018-11-19/near/147987803" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> tmandry <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/weekly.20meeting.202018-11-19.html#147987803">(Nov 19 2018 at 19:26)</a>:</h4>
<p>yeah, that helps. but if we are linking to several blog-post-length sections, it can be intimidating :)</p>



<a name="147987820"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/weekly%20meeting%202018-11-19/near/147987820" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/weekly.20meeting.202018-11-19.html#147987820">(Nov 19 2018 at 19:27)</a>:</h4>
<p><span class="user-mention" data-user-id="131694">@scalexm</span> yes that is correct</p>



<a name="147987827"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/weekly%20meeting%202018-11-19/near/147987827" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/weekly.20meeting.202018-11-19.html#147987827">(Nov 19 2018 at 19:27)</a>:</h4>
<p>more generally, there are a set of early-bound things (which include all types)</p>



<a name="147987832"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/weekly%20meeting%202018-11-19/near/147987832" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/weekly.20meeting.202018-11-19.html#147987832">(Nov 19 2018 at 19:27)</a>:</h4>
<p>those are identified by the <code>generics_of(def_id)</code></p>



<a name="147987920"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/weekly%20meeting%202018-11-19/near/147987920" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> scalexm <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/weekly.20meeting.202018-11-19.html#147987920">(Nov 19 2018 at 19:28)</a>:</h4>
<p>ok but then in <code>typeck_tables_of</code> the code first gets the <code>param_env</code> for the fn with def-if <code>def_id</code> and signature <code>fn_sig</code>, and then calls <code>tcx.liberate_late_bound_regions(def_id, &amp;fn_sig);</code></p>



<a name="147987947"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/weekly%20meeting%202018-11-19/near/147987947" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> scalexm <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/weekly.20meeting.202018-11-19.html#147987947">(Nov 19 2018 at 19:28)</a>:</h4>
<p>so what I don't understand it that there seems to be <code>ReEarlyBound</code> regions in the <code>param_env</code>, but <code>ReFree</code> regions in the <code>fn_sig</code></p>



<a name="147987986"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/weekly%20meeting%202018-11-19/near/147987986" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/weekly.20meeting.202018-11-19.html#147987986">(Nov 19 2018 at 19:29)</a>:</h4>
<p>right</p>



<a name="147987998"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/weekly%20meeting%202018-11-19/near/147987998" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/weekly.20meeting.202018-11-19.html#147987998">(Nov 19 2018 at 19:29)</a>:</h4>
<p>so</p>



<a name="147988007"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/weekly%20meeting%202018-11-19/near/147988007" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/weekly.20meeting.202018-11-19.html#147988007">(Nov 19 2018 at 19:29)</a>:</h4>
<p>I actually forget if we changed this, I guess not</p>



<a name="147988019"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/weekly%20meeting%202018-11-19/near/147988019" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/weekly.20meeting.202018-11-19.html#147988019">(Nov 19 2018 at 19:29)</a>:</h4>
<p>let me quickly review the code :)</p>



<a name="147988099"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/weekly%20meeting%202018-11-19/near/147988099" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/weekly.20meeting.202018-11-19.html#147988099">(Nov 19 2018 at 19:30)</a>:</h4>
<p>ok so</p>



<a name="147988114"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/weekly%20meeting%202018-11-19/near/147988114" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/weekly.20meeting.202018-11-19.html#147988114">(Nov 19 2018 at 19:30)</a>:</h4>
<p>we have this split (iirc)</p>



<a name="147988125"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/weekly%20meeting%202018-11-19/near/147988125" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/weekly.20meeting.202018-11-19.html#147988125">(Nov 19 2018 at 19:30)</a>:</h4>
<p>early-bound things (types, regions) we don't change, we just know from context</p>



<a name="147988130"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/weekly%20meeting%202018-11-19/near/147988130" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/weekly.20meeting.202018-11-19.html#147988130">(Nov 19 2018 at 19:30)</a>:</h4>
<p>if something is bound or not</p>



<a name="147988183"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/weekly%20meeting%202018-11-19/near/147988183" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/weekly.20meeting.202018-11-19.html#147988183">(Nov 19 2018 at 19:31)</a>:</h4>
<p>basically, when we first access a term (e.g., the signature), it contains references to early-bound things in it (<code>ReEarlyBound</code>, <code>TyParam</code>). If those should be instantiated existentially, then the first thing we do is to substitute</p>



<a name="147988201"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/weekly%20meeting%202018-11-19/near/147988201" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/weekly.20meeting.202018-11-19.html#147988201">(Nov 19 2018 at 19:31)</a>:</h4>
<p>when otoh we are type-checking the function (or impl, whatever), we leave them in place</p>



<a name="147988209"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/weekly%20meeting%202018-11-19/near/147988209" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/weekly.20meeting.202018-11-19.html#147988209">(Nov 19 2018 at 19:31)</a>:</h4>
<p>and then they are treated as placeholders</p>



<a name="147988217"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/weekly%20meeting%202018-11-19/near/147988217" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/weekly.20meeting.202018-11-19.html#147988217">(Nov 19 2018 at 19:31)</a>:</h4>
<p>does that sound right so far, <span class="user-mention" data-user-id="131694">@scalexm</span> ?</p>



<a name="147988268"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/weekly%20meeting%202018-11-19/near/147988268" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> scalexm <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/weekly.20meeting.202018-11-19.html#147988268">(Nov 19 2018 at 19:32)</a>:</h4>
<p><span class="user-mention" data-user-id="116009">@nikomatsakis</span> yes that sounds right</p>



<a name="147988272"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/weekly%20meeting%202018-11-19/near/147988272" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/weekly.20meeting.202018-11-19.html#147988272">(Nov 19 2018 at 19:32)</a>:</h4>
<p>otoh, for late-bound things, we sort of do the opposite :)</p>



<a name="147988277"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/weekly%20meeting%202018-11-19/near/147988277" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/weekly.20meeting.202018-11-19.html#147988277">(Nov 19 2018 at 19:32)</a>:</h4>
<p>they are stored in "bound form"</p>



<a name="147988292"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/weekly%20meeting%202018-11-19/near/147988292" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/weekly.20meeting.202018-11-19.html#147988292">(Nov 19 2018 at 19:32)</a>:</h4>
<p>so when you reference, you get back a <code>Binder&lt;Term&gt;</code>, which you can just use "as is"</p>



<a name="147988313"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/weekly%20meeting%202018-11-19/near/147988313" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/weekly.20meeting.202018-11-19.html#147988313">(Nov 19 2018 at 19:33)</a>:</h4>
<p>but when you want to type-check the fn, we invoke <code>liberate_late_bound_regions</code>, which basically replaces the bound regions with placeholders (making them "free", in some sense -- "liberating" them)</p>



<a name="147988325"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/weekly%20meeting%202018-11-19/near/147988325" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/weekly.20meeting.202018-11-19.html#147988325">(Nov 19 2018 at 19:33)</a>:</h4>
<p>they are free in the sense that they are not bound in the term, anyway</p>



<a name="147988407"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/weekly%20meeting%202018-11-19/near/147988407" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/weekly.20meeting.202018-11-19.html#147988407">(Nov 19 2018 at 19:34)</a>:</h4>
<p>I'm not wild about this scheme, but it reflects the "essence" of the early- vs late-bound distinction:</p>



<a name="147988433"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/weekly%20meeting%202018-11-19/near/147988433" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/weekly.20meeting.202018-11-19.html#147988433">(Nov 19 2018 at 19:34)</a>:</h4>
<p>early-bound things are always fully instantiated when you reference something, so they never appear bound in a type</p>



<a name="147988440"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/weekly%20meeting%202018-11-19/near/147988440" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/weekly.20meeting.202018-11-19.html#147988440">(Nov 19 2018 at 19:34)</a>:</h4>
<p>but late-bound things <em>do</em> appear bound in the resulting type, and are instantiated later (e.g., at the point of calling a function)</p>



<a name="147988511"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/weekly%20meeting%202018-11-19/near/147988511" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> scalexm <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/weekly.20meeting.202018-11-19.html#147988511">(Nov 19 2018 at 19:35)</a>:</h4>
<p>mmh ok so if I have a function say</p>
<div class="codehilite"><pre><span></span><span class="k">fn</span> <span class="nf">foo</span><span class="o">&lt;</span><span class="na">&#39;a</span><span class="o">&gt;</span><span class="p">()</span><span class="w"> </span><span class="p">{</span><span class="w"></span>
<span class="w">    </span><span class="kd">let</span><span class="w"> </span><span class="n">x</span>: <span class="kp">&amp;</span><span class="na">&#39;a</span><span class="w"> </span><span class="kt">i32</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="p">...;</span><span class="w"></span>
<span class="p">}</span><span class="w"></span>
</pre></div>


<p>then the type of <code>x</code> as seen from inside the body of <code>foo</code> will use an <code>ReEarlyBound</code>?</p>



<a name="147988516"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/weekly%20meeting%202018-11-19/near/147988516" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> scalexm <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/weekly.20meeting.202018-11-19.html#147988516">(Nov 19 2018 at 19:36)</a>:</h4>
<p>I mean during typecheck</p>



<a name="147988610"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/weekly%20meeting%202018-11-19/near/147988610" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/weekly.20meeting.202018-11-19.html#147988610">(Nov 19 2018 at 19:36)</a>:</h4>
<p>well</p>



<a name="147988625"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/weekly%20meeting%202018-11-19/near/147988625" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/weekly.20meeting.202018-11-19.html#147988625">(Nov 19 2018 at 19:37)</a>:</h4>
<p>that particular example is I <em>think</em> going to be late-bound</p>



<a name="147988630"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/weekly%20meeting%202018-11-19/near/147988630" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/weekly.20meeting.202018-11-19.html#147988630">(Nov 19 2018 at 19:37)</a>:</h4>
<p>let me give you a canonical example :)</p>



<a name="147988664"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/weekly%20meeting%202018-11-19/near/147988664" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/weekly.20meeting.202018-11-19.html#147988664">(Nov 19 2018 at 19:37)</a>:</h4>
<div class="codehilite"><pre><span></span><span class="k">fn</span> <span class="nf">foo</span><span class="o">&lt;</span><span class="na">&#39;early</span><span class="p">,</span><span class="w"> </span><span class="na">&#39;late</span><span class="o">&gt;</span><span class="p">(</span><span class="n">x</span>: <span class="kp">&amp;</span><span class="na">&#39;late</span><span class="w"> </span><span class="n">Foo</span><span class="p">,</span><span class="w"> </span><span class="n">y</span>: <span class="kp">&amp;</span><span class="na">&#39;early</span><span class="w"> </span><span class="n">Bar</span><span class="p">)</span><span class="w"> </span>-&gt; <span class="kp">&amp;</span><span class="na">&#39;late</span><span class="w"> </span><span class="kt">u32</span><span class="w"></span>
<span class="k">where</span><span class="w"> </span><span class="n">Bar</span>: <span class="nc">SomeTrait</span><span class="o">&lt;</span><span class="na">&#39;early</span><span class="o">&gt;</span><span class="w"> </span><span class="p">{</span><span class="w"> </span><span class="p">...</span><span class="w"> </span><span class="p">}</span><span class="w"></span>
</pre></div>



<a name="147988675"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/weekly%20meeting%202018-11-19/near/147988675" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/weekly.20meeting.202018-11-19.html#147988675">(Nov 19 2018 at 19:37)</a>:</h4>
<p>in this case, <code>'early</code> will (in typeck) be represented by an <code>ReEarlyBound</code></p>



<a name="147988755"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/weekly%20meeting%202018-11-19/near/147988755" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/weekly.20meeting.202018-11-19.html#147988755">(Nov 19 2018 at 19:38)</a>:</h4>
<p><code>fn_sig(foo)</code> will give back a <code>Binder&lt;FnSig&gt;</code>, where the <code>FnSig</code> references <code>'early</code>  represented using an <code>ReEarlyBound</code>, but references <code>'late</code> with a debruijn depth of <code>INNERMOST</code></p>



<a name="147988773"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/weekly%20meeting%202018-11-19/near/147988773" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/weekly.20meeting.202018-11-19.html#147988773">(Nov 19 2018 at 19:39)</a>:</h4>
<p>when type-checking the body then, the <code>ReBound</code> for <code>'late</code> would be converted to a <code>ReFree</code></p>



<a name="147988854"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/weekly%20meeting%202018-11-19/near/147988854" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/weekly.20meeting.202018-11-19.html#147988854">(Nov 19 2018 at 19:40)</a>:</h4>
<p>The rule for what is early vs late is something like this: we prefer late, but we use early if:</p>
<ul>
<li>the region appears in the return type but not a parameter</li>
<li>or, the region is referenced in a where clause</li>
</ul>



<a name="147988862"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/weekly%20meeting%202018-11-19/near/147988862" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> tmandry <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/weekly.20meeting.202018-11-19.html#147988862">(Nov 19 2018 at 19:40)</a>:</h4>
<p>relevant docs for those trying to follow along.. <a href="https://rust-lang-nursery.github.io/rustc-guide/appendix/background.html#free-vs-bound" target="_blank" title="https://rust-lang-nursery.github.io/rustc-guide/appendix/background.html#free-vs-bound">free-vs-bound</a>, <a href="https://doc.rust-lang.org/nightly/nightly-rustc/rustc/ty/enum.RegionKind.html" target="_blank" title="https://doc.rust-lang.org/nightly/nightly-rustc/rustc/ty/enum.RegionKind.html">RegionKind (early vs late bound)</a>, <a href="https://doc.rust-lang.org/nightly/nightly-rustc/rustc/ty/struct.Binder.html" target="_blank" title="https://doc.rust-lang.org/nightly/nightly-rustc/rustc/ty/struct.Binder.html">Binder</a>, <a href="https://rust-lang-nursery.github.io/chalk/doc/chalk_engine/context/trait.Context.html" target="_blank" title="https://rust-lang-nursery.github.io/chalk/doc/chalk_engine/context/trait.Context.html">chalk Context</a> :)</p>



<a name="147988928"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/weekly%20meeting%202018-11-19/near/147988928" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> scalexm <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/weekly.20meeting.202018-11-19.html#147988928">(Nov 19 2018 at 19:41)</a>:</h4>
<p><span class="user-mention" data-user-id="116009">@nikomatsakis</span> ok I see, then why couldn't we just eagerly replace all parameter regions with placeholders or something during typeck?</p>



<a name="147988934"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/weekly%20meeting%202018-11-19/near/147988934" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/weekly.20meeting.202018-11-19.html#147988934">(Nov 19 2018 at 19:41)</a>:</h4>
<p>one way to think about it is, if you were to write a </p>
<div class="codehilite"><pre><span></span><span class="k">impl</span><span class="o">&lt;</span><span class="na">&#39;early</span><span class="p">,</span><span class="w"> </span><span class="na">&#39;late</span><span class="o">&gt;</span><span class="w"> </span><span class="nb">FnMut</span><span class="o">&lt;</span><span class="n">ArgumentTypes</span><span class="o">&gt;</span><span class="w"> </span><span class="k">for</span><span class="w"> </span><span class="n">SomeFunctionType</span><span class="w"></span>
<span class="k">where</span><span class="w"> </span><span class="n">WC</span><span class="w"> </span><span class="p">{</span><span class="w"></span>
<span class="w">    </span><span class="k">type</span> <span class="nc">Output</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="p">...;</span><span class="w"></span>
<span class="p">}</span><span class="w"></span>
</pre></div>


<p>would the <code>'early</code> have to be appear in the <code>SomeFunctionType</code> for this to be legal?</p>



<a name="147988945"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/weekly%20meeting%202018-11-19/near/147988945" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/weekly.20meeting.202018-11-19.html#147988945">(Nov 19 2018 at 19:41)</a>:</h4>
<p>(if so, it is early)</p>



<a name="147989024"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/weekly%20meeting%202018-11-19/near/147989024" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/weekly.20meeting.202018-11-19.html#147989024">(Nov 19 2018 at 19:42)</a>:</h4>
<p><span class="user-mention" data-user-id="131694">@scalexm</span> we actually used to do that, we used to use <code>ReFree</code> for <em>all</em> regions</p>



<a name="147989043"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/weekly%20meeting%202018-11-19/near/147989043" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/weekly.20meeting.202018-11-19.html#147989043">(Nov 19 2018 at 19:42)</a>:</h4>
<p>it was effectively a U0 "placeholder", in this role</p>



<a name="147989049"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/weekly%20meeting%202018-11-19/near/147989049" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/weekly.20meeting.202018-11-19.html#147989049">(Nov 19 2018 at 19:42)</a>:</h4>
<p><span class="user-mention" data-user-id="119009">@eddyb</span> refactored it some time back</p>



<a name="147989052"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/weekly%20meeting%202018-11-19/near/147989052" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/weekly.20meeting.202018-11-19.html#147989052">(Nov 19 2018 at 19:42)</a>:</h4>
<p>I'd like to eventually move <em>back</em> to that scheme, but treating types + regions analogously</p>



<a name="147989090"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/weekly%20meeting%202018-11-19/near/147989090" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> scalexm <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/weekly.20meeting.202018-11-19.html#147989090">(Nov 19 2018 at 19:43)</a>:</h4>
<p>it seems that now that we have <code>Placeholder</code> types we could do that</p>



<a name="147989100"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/weekly%20meeting%202018-11-19/near/147989100" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/weekly.20meeting.202018-11-19.html#147989100">(Nov 19 2018 at 19:43)</a>:</h4>
<p>yeah, plausibly</p>



<a name="147989122"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/weekly%20meeting%202018-11-19/near/147989122" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/weekly.20meeting.202018-11-19.html#147989122">(Nov 19 2018 at 19:43)</a>:</h4>
<p>it'd be good to revisit the PR where <span class="user-mention" data-user-id="119009">@eddyb</span> made the change</p>



<a name="147989138"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/weekly%20meeting%202018-11-19/near/147989138" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/weekly.20meeting.202018-11-19.html#147989138">(Nov 19 2018 at 19:43)</a>:</h4>
<p>to try and remember the motivations</p>



<a name="147989147"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/weekly%20meeting%202018-11-19/near/147989147" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/weekly.20meeting.202018-11-19.html#147989147">(Nov 19 2018 at 19:43)</a>:</h4>
<p>there might be some runtime cost</p>



<a name="147989149"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/weekly%20meeting%202018-11-19/near/147989149" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/weekly.20meeting.202018-11-19.html#147989149">(Nov 19 2018 at 19:43)</a>:</h4>
<p>er, compile-time</p>



<a name="147989150"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/weekly%20meeting%202018-11-19/near/147989150" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/weekly.20meeting.202018-11-19.html#147989150">(Nov 19 2018 at 19:43)</a>:</h4>
<p>from doing more substitutions etc</p>



<a name="147989191"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/weekly%20meeting%202018-11-19/near/147989191" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> scalexm <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/weekly.20meeting.202018-11-19.html#147989191">(Nov 19 2018 at 19:44)</a>:</h4>
<p>(in my <code>environment</code> query which returns a <code>traits::Environment</code>, the <code>traits::Environment</code> just refers to <code>BoundVar</code> things so that we could substitute them with anything we want)</p>



<a name="147989208"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/weekly%20meeting%202018-11-19/near/147989208" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/weekly.20meeting.202018-11-19.html#147989208">(Nov 19 2018 at 19:44)</a>:</h4>
<p>(in general, I am not super happy with the whole early vs late distinction; though removing it altogether is not entirely backwards compatible)</p>



<a name="147989217"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/weekly%20meeting%202018-11-19/near/147989217" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/weekly.20meeting.202018-11-19.html#147989217">(Nov 19 2018 at 19:44)</a>:</h4>
<p>(but maybe something we could get away with)</p>



<a name="147989251"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/weekly%20meeting%202018-11-19/near/147989251" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/weekly.20meeting.202018-11-19.html#147989251">(Nov 19 2018 at 19:44)</a>:</h4>
<p>in short, once we have higher-ranked trait-bounds over types, everything could plausibly become late-bound</p>



<a name="147989268"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/weekly%20meeting%202018-11-19/near/147989268" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/weekly.20meeting.202018-11-19.html#147989268">(Nov 19 2018 at 19:45)</a>:</h4>
<p>(er, is this true...maybe not...)</p>



<a name="147989293"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/weekly%20meeting%202018-11-19/near/147989293" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/weekly.20meeting.202018-11-19.html#147989293">(Nov 19 2018 at 19:45)</a>:</h4>
<p>that may not be true actually :)</p>



<a name="147989395"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/weekly%20meeting%202018-11-19/near/147989395" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/weekly.20meeting.202018-11-19.html#147989395">(Nov 19 2018 at 19:46)</a>:</h4>
<p>e.g., <code>fn foo&lt;'a&gt;() -&gt; &amp;'a usize</code>, I believe this cannot be late-bound -- if you go back to my impl, it would be</p>
<div class="codehilite"><pre><span></span><span class="k">impl</span><span class="o">&lt;</span><span class="na">&#39;a</span><span class="o">&gt;</span><span class="w"> </span><span class="nb">Fn</span><span class="o">&lt;</span><span class="p">()</span><span class="o">&gt;</span><span class="w"> </span><span class="k">for</span><span class="w"> </span><span class="n">Foo</span><span class="w"> </span><span class="p">{</span><span class="w"></span>
<span class="w">    </span><span class="k">type</span> <span class="nc">Output</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="o">&amp;</span><span class="na">&#39;a</span><span class="w"> </span><span class="kt">usize</span><span class="p">;</span><span class="w"></span>
<span class="p">}</span><span class="w"></span>
</pre></div>


<p>which is illegal. The <code>'a</code> must be "constrained" by <em>some</em> input type to the trait</p>



<a name="147989420"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/weekly%20meeting%202018-11-19/near/147989420" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/weekly.20meeting.202018-11-19.html#147989420">(Nov 19 2018 at 19:46)</a>:</h4>
<p>otherwise, you could "project" <code>&lt;Foo as Fn&gt;::Output</code> to different types each time</p>



<a name="147989452"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/weekly%20meeting%202018-11-19/near/147989452" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/weekly.20meeting.202018-11-19.html#147989452">(Nov 19 2018 at 19:47)</a>:</h4>
<p>(does that make sense? I'm not sure if that impl analogy is clear to others :)</p>



<a name="147989473"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/weekly%20meeting%202018-11-19/near/147989473" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> scalexm <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/weekly.20meeting.202018-11-19.html#147989473">(Nov 19 2018 at 19:47)</a>:</h4>
<p>it makes sense to me at least</p>



<a name="147989579"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/weekly%20meeting%202018-11-19/near/147989579" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/weekly.20meeting.202018-11-19.html#147989579">(Nov 19 2018 at 19:48)</a>:</h4>
<p><em>anyway</em> I'd still think we might be able to erase the distinction in some sense, such that they are treated more analogously. i.e., there is one set of parameters (as you would have on the impl...) but only some of them are "constrained" to be part of the resulting self type, and hence cannot be higher-ranked</p>



<a name="147989595"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/weekly%20meeting%202018-11-19/near/147989595" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/weekly.20meeting.202018-11-19.html#147989595">(Nov 19 2018 at 19:48)</a>:</h4>
<p>I haven't really thought hard about this</p>



<a name="147989622"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/weekly%20meeting%202018-11-19/near/147989622" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/weekly.20meeting.202018-11-19.html#147989622">(Nov 19 2018 at 19:48)</a>:</h4>
<p>well I guess you could imagine that the resulting type of a function has <em>all</em> its parameters</p>



<a name="147989630"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/weekly%20meeting%202018-11-19/near/147989630" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/weekly.20meeting.202018-11-19.html#147989630">(Nov 19 2018 at 19:49)</a>:</h4>
<p>but maybe has a <code>for</code> binder in it</p>



<a name="147989648"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/weekly%20meeting%202018-11-19/near/147989648" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/weekly.20meeting.202018-11-19.html#147989648">(Nov 19 2018 at 19:49)</a>:</h4>
<p>anyway</p>



<a name="147989653"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/weekly%20meeting%202018-11-19/near/147989653" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/weekly.20meeting.202018-11-19.html#147989653">(Nov 19 2018 at 19:49)</a>:</h4>
<p>way far afield</p>



<a name="147989682"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/weekly%20meeting%202018-11-19/near/147989682" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/weekly.20meeting.202018-11-19.html#147989682">(Nov 19 2018 at 19:49)</a>:</h4>
<p>tl;dr I think <span class="user-mention" data-user-id="131694">@scalexm</span> there is room to represent things better, but that's how it works today...</p>



<a name="147989811"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/weekly%20meeting%202018-11-19/near/147989811" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> scalexm <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/weekly.20meeting.202018-11-19.html#147989811">(Nov 19 2018 at 19:50)</a>:</h4>
<p><span class="user-mention" data-user-id="116009">@nikomatsakis</span> ok then I think I won't try to do anything clever for now and just use the same lifetimes in <code>traits::Environment</code> as it would be in the <code>ty::ParamEnv</code> analog</p>



<a name="147989844"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/weekly%20meeting%202018-11-19/near/147989844" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/weekly.20meeting.202018-11-19.html#147989844">(Nov 19 2018 at 19:50)</a>:</h4>
<p>seems good</p>



<a name="147990025"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/weekly%20meeting%202018-11-19/near/147990025" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/weekly.20meeting.202018-11-19.html#147990025">(Nov 19 2018 at 19:52)</a>:</h4>
<p>gotta run to another meeting :)</p>



<a name="147991259"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/weekly%20meeting%202018-11-19/near/147991259" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Alexander Regueiro <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/weekly.20meeting.202018-11-19.html#147991259">(Nov 19 2018 at 20:08)</a>:</h4>
<p>hey <span class="user-mention" data-user-id="131694">@scalexm</span></p>



<a name="147991293"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/weekly%20meeting%202018-11-19/near/147991293" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Alexander Regueiro <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/weekly.20meeting.202018-11-19.html#147991293">(Nov 19 2018 at 20:09)</a>:</h4>
<p>how's your work going? started on serious integration of chalk stuff yet?</p>



<a name="147992228"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/weekly%20meeting%202018-11-19/near/147992228" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Alexander Regueiro <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/weekly.20meeting.202018-11-19.html#147992228">(Nov 19 2018 at 20:22)</a>:</h4>
<p>ooh, I see in the notes you've been doing some work on that on your local branch :-)</p>



<a name="147992230"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/weekly%20meeting%202018-11-19/near/147992230" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Alexander Regueiro <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/weekly.20meeting.202018-11-19.html#147992230">(Nov 19 2018 at 20:22)</a>:</h4>
<p>super</p>



<a name="147995821"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/weekly%20meeting%202018-11-19/near/147995821" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Alexander Regueiro <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/weekly.20meeting.202018-11-19.html#147995821">(Nov 19 2018 at 21:15)</a>:</h4>
<p><span class="user-mention" data-user-id="116009">@nikomatsakis</span> gone for the day?</p>



<a name="148048972"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/weekly%20meeting%202018-11-19/near/148048972" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Alexander Regueiro <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/weekly.20meeting.202018-11-19.html#148048972">(Nov 20 2018 at 16:02)</a>:</h4>
<p><span class="user-mention" data-user-id="116009">@nikomatsakis</span> let me know when you're around for a catch-up</p>



<a name="148059855"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/weekly%20meeting%202018-11-19/near/148059855" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> DPC <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/weekly.20meeting.202018-11-19.html#148059855">(Nov 20 2018 at 19:06)</a>:</h4>
<p><span class="user-mention" data-user-id="116009">@nikomatsakis</span> if you are looking for someone to continue the work on <a href="https://github.com/rust-lang/rust/issues/55097" target="_blank" title="https://github.com/rust-lang/rust/issues/55097">#55097</a>, I'm available <span class="emoji emoji-1f600" title="grinning">:grinning:</span></p>



<a name="148060010"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/weekly%20meeting%202018-11-19/near/148060010" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/weekly.20meeting.202018-11-19.html#148060010">(Nov 20 2018 at 19:08)</a>:</h4>
<p><span class="user-mention" data-user-id="120823">@DPC</span> go for it! Unless <span class="user-mention" data-user-id="131694">@scalexm</span> has already done it</p>



<a name="148060079"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/weekly%20meeting%202018-11-19/near/148060079" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> scalexm <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/weekly.20meeting.202018-11-19.html#148060079">(Nov 20 2018 at 19:10)</a>:</h4>
<p><span class="user-mention" data-user-id="120823">@DPC</span> yeah I’ve done it in a local branch :p</p>



<a name="148065599"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/weekly%20meeting%202018-11-19/near/148065599" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> DPC <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/weekly.20meeting.202018-11-19.html#148065599">(Nov 20 2018 at 20:29)</a>:</h4>
<p>Ah no problems</p>



<hr><p>Last updated: Aug 07 2021 at 22:04 UTC</p>
</html>